package com.chinatelecom.ifree.business.service.vote.impl;

import java.util.Map;

import javax.annotation.Resource;

import org.springframework.stereotype.Service;

import com.chinatelecom.ifree.business.dao.vote.VoteDao;
import com.chinatelecom.ifree.business.domain.vote.VoteDetail;
import com.chinatelecom.ifree.business.service.vote.VoteService;

@Service
public class VoteServiceImpl implements VoteService {

	@Resource
	private VoteDao voteDao ;
	
	@Override
	public Map<Long, Integer> getVoteCountByVoteId(long voteid) throws Exception {
		return voteDao.getVoteCountByVoteId(voteid) ;
	}

	@Override
	public void saveVoteDetail(VoteDetail voteDetail) throws Exception {
		
		voteDao.saveVoteDetail(voteDetail);
	}
	
	@Override
	public void saveVoteDetailList(VoteDetail[] voteDetailArr) throws Exception {
		voteDao.saveVoteDetailList(voteDetailArr);
	}

	@Override
	public int getVoteCountByVoteItemId(long voteitemid) throws Exception {
		return voteDao.getVoteCountByVoteItemId(voteitemid);
	}
	@Override
	public Map<Long, Integer>  getVoteCountByVoteIdAndCookie(long voteid ,String cookie) throws Exception {
		return voteDao.getVoteCountByVoteIdAndCookie(voteid , cookie);
	}

}
